	<div class="row">
	    <div class="col-xs-12">
	        <div class="box box-primary">
	            <div class="box-header">
                <h3 class="box-title">Surat Kontrol</h3>
                <span class="box-title tmb-title">
                	<a href="<?php echo site_url('surat_kontrol/add')?>" class="btn btn-xs btn-primary btn-flat"><i class="ion-plus-round"></i>&nbsp;&nbsp;Tambah</button></a>
                </span>
                <div class="box-tools box-cari">
                <?=form_open('surat_kontrol/cari', array('class' => 'form-inline'))?>
	                <div class="form-group">
								    <label class="sr-only" for="exampleInputEmail2">Tanggal Awal</label>
								    <input type="text" name="tgl_awal" value="<?=$this->session->userdata('tgl_awal');?>" class="form-control input-sm" id="tgl_awal" placeholder="Tanggal Awal">
								  </div>
								  <div class="form-group">
								    <label class="sr-only" for="exampleInputPassword2">Tanggal Akhir</label>
								    <input type="text" name="tgl_akhir" value="<?=$this->session->userdata('tgl_akhir');?>" class="form-control input-sm" id="tgl_akhir" placeholder="Tanggal Akhir">
								  </div>
								  <div class="input-group">
		                <input type="text" name="keyword" value="<?=$this->session->userdata('keyword');?>"class="form-control input-sm pull-right" placeholder="Cari nama/kode jaminan..."/>
		                <div class="input-group-btn">
		                  <button type="submit" name="submit" class="btn btn-sm btn-default btn-flat"><i class="fa fa-search"></i></button>
		                </div>
		              </div>
	              <?=form_close();?>
              	</div>
	            </div><!-- /.box-header -->
	            <div class="box-body box-export-tools table-responsive">
	            	<span class="notif notif-primary" <?php if(is_string($this->session->flashdata('sukses'))){echo 'style="display:block;"';}else{echo 'style="display:none;"';}?>>
	            		<i class="fa fa-check"></i>
	            		<?php echo $this->session->flashdata('sukses'); ?>
	            		<button type="button" class="close">&times;</button>
	            	</span>

	            	<span class="notif notif-danger" <?php if(is_string($this->session->flashdata('gagal'))){echo 'style="display:block;"';}else{echo 'style="display:none;"';}?>>
	            		<i class="fa fa-check"></i>
	            		<?php echo $this->session->flashdata('gagal'); ?>
	            		<button type="button" class="close">&times;</button>
	            	</span>

	            	<div class="pull-right">
		            	<a href="<?php echo site_url('surat_jaminan/excel')?>" class="btn btn-xs btn-tbl btn-flat"><i class="fa fa-file-excel-o"></i>&nbsp;&nbsp;Save as Excel</button></a>
	                <!-- <a href="<?php echo site_url('surat_jaminan/pdf')?>" target="_blank" class="btn btn-xs btn-tbl btn-flat"><i class="fa fa-file-pdf-o"></i>&nbsp;&nbsp;Save as PDF</button></a>  	 -->
                </div>
                <table class="table table-hover table-condensed table-striped">
									<thead>
									<tr>
										<th style="text-align:center;" width="3%">#</th>
										<th width="15%">Kode Jaminan</th>
										<th width="10%">Tanggal</th>
										<th width="20%">Nama Pasien</th>
										<th width="5%">JK</th>
										<th width="15%">Alamat</th>
										<th>Kode Klaim</th>
										<th></th>
									</tr>
									</thead>
									<?php 
										if(!empty($results)){
											foreach ($results as $row) {
												?>
												<tr>
													<td width="3%" align="center"><?php echo $ordinal_num++ ?></td>
													<td><?php echo $row['kd_surat_jaminan']?></td>
													<td><?php echo id_date($row['tgl_surat'])?></td>
													<td><?php echo $row['nama']?></td>
													<td><?php echo $row['jk']?></td>
													<td><?php echo $row['alamat']?></td>
													<td><?php echo $row['kd_klaim']?></td>
													<td>
														<span class="pull-right">
															<?php echo anchor('surat_kontrol/detail/'.$row['kd_klaim'].'','Lihat','class="label label-primary" title="Lihat data surat jaminan"'); ?>
															<?php //echo anchor('surat_jaminan/edit/'.$row['kd_surat_jaminan'].'','Edit','class="label label-warning" title="Edit data surat jaminan"'); ?>
															<?php //echo anchor('surat_jaminan/delete/'.$row['kd_surat_jaminan'].'','Hapus','class="label label-danger" title="Hapus data surat jaminan" onClick="return confirm(\'Yakin ingin menghapus '.$row['nama'].' dari data surat jaminan?\');"'); ?>
														</span>
													</td>
												</tr>
												<?php 
											}
										}else{
									?>
									<tr>
										<td colspan="7" align="center">Tidak ada data</td>
									</tr>
									<?php
										}
									?>							
								</table>									
	            </div><!-- /.box-body -->
	            <div class="box-footer clearfix">
                <ul class="pagination pagination-sm no-margin pull-right">
                  <?php echo $pagination; ?>
                </ul>        
	            </div>
	        </div><!-- /.box -->                            
	    </div>
	</div>

<script type="text/javascript">
  $(document).ready(function(){
    $('#tgl_awal, #tgl_akhir').datepicker({
      dateFormat: "dd/mm/yy",
      changeMonth: true,
      changeYear: true
    });
  });
</script>   